{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="css"}

{/block}
{block name="content"}
<form id='base_config' action='' method='POST'>

    <div id="add_hot" class="formactions mgl180">
        <a href="javascript:;" onclick="add_hot_city()" ; class="btn btn-blue"><i class="gicon-plus white"></i>添加热门城市</a>
    </div>

    {foreach from = $hot_city_arr item = hot}
    <div class="formitems inline">
        <label class="fi-name"><span class="colorRed">*</span>热门城市：</label>
        <div class="form-controls">
            <select name="hot_city[]">
                <option value="0">--请选择--</option>
                {foreach from=$city_list item = city key = key}
                <option value="{$city.city_id}" {if $city.city_id == $hot}selected{/if}>{$city.city_name}</option>
                {/foreach}
            </select>
            <span class="fi-help-text hide"></span>
            <a href="javascript:;" onclick="del_qj($(this))" class="btn" title="删除"><i class="gicon-trash black"></i>删除</a>
        </div>
    </div>
    {/foreach}


    <div class="formitems inline">
        <label class="fi-name"></label>
        <div class="form-controls">
            <input type='hidden' name='act' value='save'/>
            <button type="submit" class="btn btn-blue"><i class="gicon-check white"></i>确定</button>
            <button type="reset" class="btn"><i class="gicon-repeat"></i>重置</button>
        </div>
    </div>
</form>
{/block}

{block name="js"}
<script>
    function add_hot_city() {

        var html = '<div class="formitems inline">\
                <label class="fi-name"><span class="colorRed">*</span>热门城市：</label>\
                <div class="form-controls">\
                <select name="item_id[]">\
                <option value="0">--请选择--</option>\
                {foreach from=$city_list item = city key = key}\
                 <option value="{$city.city_id}">{$city.city_name}</option>\
                {/foreach}\
                </select>\
                <span class="fi-help-text hide"></span>\
                <a href="javascript:;" onclick="del_qj($(this))" class="btn" title="删除"><i class="gicon-trash black"></i>删除</a>\
                </div>\
                </div>';

        $('#add_hot').after(html);
    }


    //删除热卖参数
    function del_qj(obj) {
        obj.parent().parent().remove();
    }

</script>
{/block}

{block name="css"}
{/block}
